#!/usr/bin/env python
# -*- coding: utf-8 -*-

'labman2 root URL dispatch rules'

from django.conf.urls import patterns, include, url

from django.conf import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

js_info_dict = { # pylint: disable=C0103
    'packages': ('labman2',)
}

urlpatterns = patterns('', # pylint: disable=C0103
    # Examples:
    # url(r'^$', 'labman2.views.home', name='home'),
    # url(r'^labman2/', include('labman2.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
#    url(r'^$', 'data.views.index'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'', include('labman2.data.urls')),

    url(r'^accounts/', include('registration.backends.default.urls')),

    #needed for javascript calendar
    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
    (r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^static/css/(?P<path>.*)$', 'django.views.static.serve',
                    {'document_root': settings.STATIC_DOC_ROOT + '/css',
                     'show_indexes': True}),
        (r'^static/js/(?P<path>.*)$', 'django.views.static.serve',
                    {'document_root': settings.STATIC_DOC_ROOT + '/js',
                     'show_indexes': True}),
        (r'^static/img/(?P<path>.*)$', 'django.views.static.serve',
                    {'document_root': settings.STATIC_DOC_ROOT + '/img',
                     'show_indexes':True}),
)
